#include<bits/stdc++.h>
using namespace std;
struct numn
{
    int a;
    int b;
};
int main()
{
    int c;
    freopen("color.in","r",stdin);
    freopen("color.out","w",stdout);
    int T;
    numn t[101001];
    cin>>T;
    while(T>0)
    {
        int ans;
        int n;
        cin>>n;
        for(int i=1;i<=n;i++)
        {
            cin>>t[i].a;
        }
        t[1].b=0;











        cout<<0;





        T--;
    }
    return 0;
}
